package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    Integer countByMap(Map<String, Object> map);

    /**
     *通过openid获取用户
     */
    @Select("select * from user where openid=#{openid}")
    User getByOpenid(String openid);

    /**
     *新增用户
     */
    void insert(User user);

    /**
     *根据id获得数据
     */
    @Select("select * from user where id=#{id}")
    User getById(Long id);
}
